﻿#ifndef PROCESS_LOGIC_H
#define PROCESS_LOGIC_H
#include <QObject>
#include <QByteArray>
#include <QString>
#include <QDebug>


#include <iostream>
#include <thread>
#include <condition_variable>
#include <mutex>
#include <queue>

class process_logic : public QObject
{
    Q_OBJECT
public:
    explicit process_logic(QObject *parent = nullptr);
    ~process_logic() = default;

    std::thread process_logic_thread;
    std::mutex mtx;
    std::condition_variable cv;
    bool data_ready = false;
    std::queue<QByteArray> q;
    QByteArray temp;

    void process_logic_triggered(QByteArray& buf);
    void process_logic_task();


signals:
    void get_display_data(QByteArray* ptr);



};

#endif // PROCESS_LOGIC_H
